﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Download.aspx.cs" Inherits="FEIStorageSite.Download" MasterPageFile="~/MasterPage.Master" %>
<%@ MasterType VirtualPath="~/MasterPage.Master" %>

<asp:Content ID="downloadPage" ContentPlaceHolderID="contentPanel" runat="server">
    <asp:Label CssClass="title" ID="downloadPageTitle" runat="server"></asp:Label>
    <asp:Label CssClass="error" ID="downloadPageError" runat="server"></asp:Label>
    
    <asp:ListView ID="categoriesListView" runat="server">
        <LayoutTemplate>
            <ul class="categoriesList">
                <li id="itemPlaceholder" runat="server"></li>
            </ul>
        </LayoutTemplate>
        <ItemTemplate>
            <li>
                <a href="Download.aspx?type=category&id=<%#Eval("ID")%>" onfocus="this.blur()"><%#Eval("Name")%>(<%#Eval("CountFiles")%>)</a> 
            </li>
        </ItemTemplate>
    </asp:ListView>
    
    <div class="pages">
        <asp:DataPager ID="downloadDataPager" PageSize="10" runat="server" OnPreRender="DownloadDataPagerPreRender" PagedControlID="filesListView">
            <Fields>       
                <asp:TemplatePagerField>
                    <PagerTemplate>
                        <span>Сторінки: </span>
                    </PagerTemplate>
                </asp:TemplatePagerField>
                <asp:NumericPagerField ButtonCount="10" NextPageText="..." PreviousPageText="..." />
            </Fields>
        </asp:DataPager>
    </div>
    <asp:ListView ID="filesListView" runat="server">
        <LayoutTemplate>
            <table cellpadding="0" cellspacing="0" class="filesTable">
                <tr class="filesTableHeader">
                    <td>Назва</td>
                    <td>Опис</td>
                    <td>Розмір</td>
                    <td>Дата завантаження</td>
                </tr>
                <tr id="itemPlaceholder" runat="server"></tr>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr>
                <td><a href="Download.aspx?type=file&id=<%#Eval("ID")%>" onfocus="this.blur()"><%#Eval("Name")%></a></td>
                <td><%#Eval("Description")%></td>
                <td><%#Eval("FileSize")%></td>
                <td><%#Eval("Date")%></td>
            </tr>
        </ItemTemplate>
    </asp:ListView>
    
    <div class="fileTableContainer">
        <table id="fileView" class="fileTable" cellpadding="0" cellspacing="0" visible="false" runat="server">
            <tr>
                <td class="filesTableHeader">Назва: </td>
                <td id="fileNameView"></td>
            </tr>
            <tr>
                <td class="filesTableHeader">Розмір: </td>
                <td id="fileSizeView"></td>
            </tr>        
            <tr>
                <td class="filesTableHeader">Опис: </td>
                <td id="fileDescriptionView"></td>
            </tr>
            <tr>
                <td class="filesTableHeader">Кількість завантажувань: </td>
                <td id="fileDownCountView"></td>
            </tr>
            <tr>
                <td class="filesTableHeader">Категорія: </td>
                <td id="fileCategoryNameView"></td>
            </tr>                
            <tr>
                <td class="filesTableHeader">Дата завантаження: </td>
                <td id="fileDateView"></td>
            </tr>    
            <tr class="table_buttons">
                <td class="filesTableHeader">Download: </td>
                <td>
                    <a id="downButton" runat="server" onfocus="this.blur()" class="down_button">&nbsp;</a>
                </td>
            </tr>                     
        </table>
    </div>
</asp:Content>